package com.audaque.springboot.foshanupload.web.openfeigndemo.controller;


import com.audaque.springboot.foshanupload.authcore.model.currentUser.TransmittableThreadLocalCurrentUser;
import com.audaque.springboot.foshanupload.web.openfeigndemo.feign.api.LogindemoFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Slf4j
@RestController
@RequestMapping("/logindemoFeignTest")
public class LogindemoFeignTestController {
    @Autowired
    private LogindemoFeign logindemoFeign;
    @GetMapping("/getCurrentUser")
    public TransmittableThreadLocalCurrentUser getCurrentUser() {
        long threadId = Thread.currentThread().getId();
        log.debug("/openfeigndemo/logindemoFeignTest/getCurrentUser:threadId："+threadId);
        return logindemoFeign.getCurrentUser( );

    }
}
